clear
capture log close
set mem 250m


*** Prepare district census data
use data_prepared_poor_law_data, clear

** Prepare for regressions
encode county, gen(county_code)
gen cot_town=0
replace cot_town=1 if cotton_emp_shr>.1

*** Label variables
label variable cot_town "Cotton city indicator"
label variable cotton_emp_shr "Cotton emp. shr."


**** Regressions
reg chg_1860_1863_shr cot_town, robust
est store R1

reg chg_1860_1863_shr cot_town, cluster(county_code)

**** Cotton shares
reg chg_1860_1863_shr cotton_emp_shr, robust
est store R2

reg chg_1860_1863_shr cotton_emp_shr, cluster(county_code)

*** Limit to only towns available in the main analysis database
drop if analysis_city==0
reg chg_1860_1863_shr cot_town, robust
est store R3

reg chg_1860_1863_shr cotton_emp_shr, robust
est store R4

reg chg_1860_1863_shr cotton_emp_shr, cluster(county_code)

outreg2 [R1 R3 R2 R4] using results_table_1, tex replace see label  drop(_I*)





************************** Table 2 Results ********************************

*** Prepare district census data
use data_prepared_poor_law_data, clear

** Prepare for regressions
encode county, gen(county_code)
gen cot_town=0
replace cot_town=1 if cotton_emp_shr>.1

*** Label variables
label variable cot_town "Cotton city indicator"
label variable cotton_emp_shr "Cotton emp. shr."


**** Regressions
reg chg_1860_1866_shr cot_town, robust
est store R1

reg chg_1860_1866_shr cot_town, cluster(county_code)

**** Cotton shares
reg chg_1860_1866_shr cotton_emp_shr, robust
est store R2

reg chg_1860_1866_shr cotton_emp_shr, cluster(county_code)

*** Limit to only towns available in the main analysis database
drop if analysis_city==0
reg chg_1860_1866_shr cot_town, robust
est store R3

reg chg_1860_1866_shr cotton_emp_shr, robust
est store R4

reg chg_1860_1866_shr cotton_emp_shr, cluster(county_code)

outreg2 [R1 R3 R2 R4] using results_table_2, tex replace see label  drop(_I*)


***
